<?php

// use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitDeliverRecord extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('deliver_records', function (Blueprint $table) {
            $table->comment = '发货表';
            
            $table->increments('id');
            $table->uuid('uuid')->index() ;

            $table->integer('order_id')->unsigned()->index()->nullable()->comment('订单id'); // 订单id

            $table->tinyInteger('deliver_type')->unsigned()->index()->default(0)->comment('0为发货  1为退货  2为重新发货'); // 0为发货  1为退货  2为重新发货
            $table->tinyInteger('type')->unsigned()->default(1)->comment('发货类型: 1、物流发货  2、无需物流'); // 发货类型: 1、物流发货  2、无需物流

            $table->string('express_name', 100)->nullable()->comment('货运公司名称'); // 货运公司名称
            $table->string('express_number', 100)->nullable()->comment('货运单号'); // 货运单号

            $table->text('content')->nullable()->comment('线上发货内容'); // 线上发货内容
            $table->text('remark')->nullable()->comment('发货备注'); // 发货备注

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('deliver_records');
    }
}
